import request from '../utils/axios-config'

// 商品相关API
export function getGoodsList() {
  return request({
    url: '/admin/goods/list',
    method: 'get'
  })
}

export function getGoodsPage(params) {
  return request({
    url: '/admin/goods/page',
    method: 'get',
    params
  })
}

export function getGoodsDetail(id) {
  return request({
    url: `/admin/goods/detail/${id}`,
    method: 'get'
  })
}

export function saveOrUpdateGoods(data) {
  return request({
    url: '/admin/goods/saveOrUpdate',
    method: 'post',
    data
  })
}

export function deleteGoods(id) {
  return request({
    url: `/admin/goods/deleteById/${id}`,
    method: 'delete'
  })
} 